/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package memsim.instructions;
import memsim.MemoryManager;
import memsim.RegisterHandler;
/**
 *
 * @author kimchouSok
 */
public class Fetch {


    public static int getFetch(MemoryManager m, RegisterHandler regHandler ){
        int instrAddress = regHandler.getPC();
        //String instrAddr = Long.toString(instrAddress);
       // System.out.println("PC IS AT:" + instrAddr);
        String temp = m.getValue(instrAddress).toString();
        int content = Integer.parseInt(temp);
        regHandler.incPC();
        System.out.println("Increasing PC " + content);
        return content;
    }
}
